package com.jingdianjichi.changerecord.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Hu_bx
 * @date 16:48 2023/9/15
 **/
@AllArgsConstructor
@Getter
public enum YesOrNoEnum {


    /**
     * YesOrNoEnum
     */
    YES("Y", "是"),
    NO("N", "否");

    private final String val;

    private final String des;


    /**
     * 获取des
     *
     * @param val val
     * @return java.lang.String
     * @author Hu_bx
     * @date 10:16 2022/11/15
     **/
    public static String getDes(String val) {
        for (YesOrNoEnum value : YesOrNoEnum.values()) {
            if (value.getVal().equals(val)) {
                return value.des;
            }
        }
        return "";
    }

}
